package com.heima.article.controller;

import com.heima.article.entity.ApAuthor;
import com.heima.article.service.IApAuthorService;
import com.heima.common.dto.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * APP文章作者信息表 前端控制器
 * </p>
 *
 * @author SpaceTraveller
 * @since 2022-11-07
 */
@RestController
@RequestMapping("/api/v1/author")
@Api(tags = "APP文章作者信息表接口")
public class ApAuthorController{

    @Autowired
    private IApAuthorService apAuthorService;

    /**
     * 保存作者信息
     * @param author
     * @return
     */
    @PutMapping
    @ApiOperation(value = "保存作者信息",notes = "author:SpaceTraveller")
    @ApiImplicitParam(name = "author",value = "请求体对象",required = true,dataType = "ApAuthor")
    public ResponseResult<ApAuthor> saveAuthor(@RequestBody ApAuthor author){
        return apAuthorService.saveAuthor(author);
    }

}
